package com.delaphone.fadmin.action;

import com.delaphone.fadmin.model.FAdmins;
import com.opensymphony.xwork2.ActionSupport;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.apache.struts2.interceptor.ServletRequestAware;
import org.apache.struts2.interceptor.ServletResponseAware;
import org.springframework.web.context.ServletContextAware;
import org.apache.log4j.Logger;

/**
 *
 * @author dongtv
 */
public class CoreAction extends ActionSupport implements ServletRequestAware, ServletResponseAware, ServletContextAware {

    protected HttpSession session;
    protected HttpServletRequest request;
    protected HttpServletResponse response;
    protected ServletContext context;
    protected Logger logger = Logger.getLogger(this.getClass().getSimpleName());
    protected FAdmins admin;

    public void setServletRequest(HttpServletRequest request) {
        this.request = request;
        session = request.getSession(true);
        admin = (FAdmins) session.getAttribute("admin");
    }

    public void setServletResponse(HttpServletResponse response) {
        this.response = response;
    }

    public void setServletContext(ServletContext context) {
        this.context = context;
    }
}
